package com.chat.enums;

import lombok.Getter;

@Getter
public enum ChatExceptionEnum {

    ERROR(500, "服务器内部错误"),
    DB_REQUEST_FAILED(501, "数据库请求失败"),
    FREQUENT_REQUESTS_PLEASE_TRY_AGAIN_LATER(1000, "请求过于频繁，请稍后再试"),
    USER_NOT_LOGGED_IN(1001, "用户未登录"),
    NOT_DETAILED(1002, "没有详细信息,请补全"),
    PASSWORD_ERROR(1003, "用户名或密码错误"),
    VERIFICATION_CODE_EXPIRED(1004, "验证码已过期"),
    THE_USERNAME_ALREADY_EXISTS(1005, "该用户名已存在"),
    VERIFICATION_CODE_ERROR(1006, "验证码错误"),
    EMAIL_AUTHENTICATION_NOT_COMPLETED(1007, "邮箱认证未完成"),
    ACCOUNT_CANNOT_BE_EMPTY(1008, "账号不能为空"),
    ACCOUNT_OR_PASSWORD_ERROR(1009, "账号或密码错误"),
    EMAIL_SEND_ERROR(1010, "邮箱发送错误"),
    EMAIL_ALREADY_EXISTS(1011, "此邮箱已被其他用户注册"),
    USER_NOT_EXIST(1012, "用户不存在"),
    ;

    private final int    code;
    private final String desc;

    ChatExceptionEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "SchoolCatExceptionEnum{" +
               "code=" + code +
               ", desc='" + desc + '\'' +
               "} " + super.toString();
    }
}

